<template>
  <div class="number-container">
    <div
      v-for="(item, index) in numArr"
      :key="index"
      :class="item === '.' ? 'comma' : 'num-item'"
    >
      {{ item }}
    </div>
  </div>
</template>

<script>
export default {
  props: {
    number: {}
  },
  computed: {
    numArr() {
      // return parseInt(this.number)
      return this.number.toLocaleString().split("");
    }
  }
};
</script>

<style lang="less" scoped>
.number-container {
  .comma {
    display: inline-block;
    justify-content: flex-end;
    font-size: 22px;
    font-weight: bold;
    color: hsl(214, 100%, 76%);
    font-family: DINAlternate-Bold, DINAlternate;
    position: relative;
    left: -3px;
  }
  .num-item {
    width: 35px;
    height: 44px;
    text-align: center;
    line-height: 44px;
    display: inline-block;
    font-size: 36px;
    font-weight: 500;
    color: #87bcff;
    background-image: url("https://oss.sdland-sea.com/group2/M01/16/47/Cof8E2I3zjWAB9wtAAAFKeLwHbg399.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center;
    margin-right: 7px;
  }
}
</style>
